import website from '@/components/storybook/settings/website'
import { get } from 'lodash'
export default (to) => {
  const path = get(to, 'path')
  let title = get(to, 'meta.title')
  if (path === '/connectWiseManageAssets') {
    title = get(to, 'query.name')
  }
  if (path.includes('/present')) {
    title = get(to, 'query.name')
  }

  if (path.includes('/dashboard') || path.includes('/report') || path.includes('/scorecard') || path.includes('/bot') || path.includes('/dataset') || path.includes('/peerGroupDetail')) {
    title = get(to, 'query.name')
  }

  return title || website.title
}
